/* =========================================================================
 *
 *   The traffic processor.
 *
 *   Development by Sedelnikov Alexander (Bigking).
 *
 * =========================================================================
 */

#ifndef __PROCESSOR_H__
#define __PROCESSOR_H__


#include "thread.h"
#include "conf.h"
#include "trf_parser.h"
#include "hashtbl/htbl.h"


//-----------------------------------------------------------------------//
class cprocessor : public cthread
{


private:
    chash_table<trf_gth>  *hash;
    cparser               *parser;


    bool                   job_complite,
                           was_error;


    uint check_by_class( ulong            ip,
                         ushort           port,
                         ushort           protocol,
                         ctraffic_class  *tc );


public:

    cprocessor();
    ~cprocessor();

    void thread_running( void );
    int  thread_run    ( void );

    void set_hash_table( chash_table<trf_gth>  *hashtbl );
    void set_parser    ( cparser               *parser  );

    bool complite();
    bool error();


};


#endif
